import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

const login = resolve => require(['../components/login'], resolve) // 登录
const layout = resolve => require(['../components/layout'], resolve) // layout
const work = resolve => require(['../components/work/work'], resolve) // 工作台
const work1 = resolve => require(['../components/work/work1'], resolve) // 工作台
const welcome =  resolve => require(['../components/welcome'], resolve) //欢迎页

//客户管理
const userList = resolve => require(['../components/user/userList/list'], resolve)  //用户列表
const userEdit = resolve => require(['../components/user/userList/edit'], resolve)  //用户详情
const vitality = resolve => require(['../components/user/vitality/list'], resolve)  //活跃度
const feedback = resolve => require(['../components/user/feedback/list'], resolve)  //用户反馈


//订单
const applyList = resolve => require(['../components/order/apply/list'], resolve) // 订单申请列表
const auditList = resolve => require(['../components/order/audit/list'], resolve) // 待人工审核列表
const auditSuccessList = resolve => require(['../components/order/auditSuccess/list'], resolve) // 审核成功列表
const auditRejectList = resolve => require(['../components/order/auditReject/list'], resolve) // 审核拒绝列表
const latePaymentList = resolve => require(['../components/order/latePayment/list'], resolve) // 逾期已还
const lateNoPaymentList = resolve => require(['../components/order/lateNoPayment/list'], resolve) // 逾期已还
const lateList = resolve => require(['../components/order/late/list'], resolve) // 逾期已还
const nowExpireList = resolve => require(['../components/order/nowExpire/list'], resolve) // 当天到期
const settleList = resolve => require(['../components/order/settle/list'], resolve) // 当天到期


//财务
const callReviewList = resolve => require(['../components/finance/callReview/list'], resolve) // 财务电核
const waitPayList = resolve => require(['../components/finance/waitPay/list'], resolve) // 待放款
const payFinishList = resolve => require(['../components/finance/payFinish/list'], resolve) // 已放款
const payFailList = resolve => require(['../components/finance/payFail/list'], resolve) // 已放款
const receiptList = resolve => require(['../components/finance/receipt/list'], resolve) // 收款流水
const waitReceiptList = resolve => require(['../components/finance/waitReceipt/list'], resolve) // 待收款统计
const repayList = resolve => require(['../components/finance/repay/list'], resolve) // 财务还款列表
const payingList = resolve => require(['../components/finance/paying/list'], resolve) // 财务还款列表

//催收
const urgeList  = resolve => require(['../components/urge/urge/list'], resolve)//催收列表
const urgeTZoneList  = resolve => require(['../components/urge/urgeTZone/list'], resolve)//当天
const urgeTOneList  = resolve => require(['../components/urge/urgeTOne/list'], resolve)//逾期1天
const manyDaysList  = resolve => require(['../components/urge/manyDays/list'], resolve)//逾期多天
const urgeMineList  = resolve => require(['../components/urge/urgeMine/list'], resolve)//逾期多天
const statisticalList  = resolve => require(['../components/urge/statistical/list'], resolve)//催收统计

//统计管理
const converRateList = resolve => require(['../components/operator/converRate/list'], resolve)  //客户转化率
const passRateList  = resolve => require(['../components/operator/passRate/list'], resolve)   //新户、老户通过率
const settleRateList = resolve => require(['../components/operator/settleRate/list'], resolve)  //结清率
const channelRateList = resolve => require(['../components/operator/channelRate/list'], resolve)  //渠道统计



//风控
const orderAuditList  = resolve => require(['../components/risk/audit/list'], resolve) //订单审核统计
const expireList = resolve => require(['../components/risk/expire/list'], resolve)//订单到期统计


//运营管理1
const bannerList  = resolve => require(['../components/operate/banner/list'], resolve) //轮播图
const channelList = resolve => require(['../components/operate/channel/list'], resolve)  //渠道管理
const creditList  = resolve => require(['../components/operate/product/list'], resolve)  //产品管理列表
const creditEdit  = resolve => require(['../components/operate/product/edit'], resolve)  //产品管理编辑
const noticeList  = resolve => require(['../components/operate/notice/list'], resolve) //公告管理


//系统管理
const menuList = resolve => require(['../components/systemManage/menuManage/menuList'], resolve) // 菜单管理
const adminUserList = resolve => require(['../components/systemManage/adminUser/list'], resolve) // 用户管理
const roleList = resolve => require(['../components/systemManage/role/list'], resolve) // 角色管理
const dictionaryList  = resolve => require(['../components/systemManage/dictionary/list'], resolve) //字典管理

const productConfigEdit = resolve => require(['../components/systemManage/productConfig/edit'], resolve) //产品配置
const withholdEdit =  resolve => require(['../components/systemManage/serviceConfig/withhold/edit'], resolve)
const messageSendEdit =  resolve => require(['../components/systemManage/serviceConfig/messageSend/edit'], resolve)
const flowConfigEdit =  resolve => require(['../components/systemManage/flowConfig/edit'], resolve)

export default new Router({
  // mode:'history',
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/work',
      name: 'layout',
      component: layout,
      meta: {
        requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
      },
      children:[
        //工作台
        {
          path:'',
          name:'work',
          component:work
        },
        {
          path:'welcome',
          name:'welcome',
          component:welcome
        },
        //系统配置
        {
          path:'menu/list',//菜单配置
          name:'menuList',
          component:menuList
        },
        {
          path:'adminUser/list',//管理员管理
          name:'adminUserList',
          component:adminUserList
        },
        {
          path:'role/list',//角色管理
          name:'roleList',
          component:roleList
        },

        {
          path:'dictionary/list',//字典管理
          name:'dictionaryList',
          component:dictionaryList

        },
        {
          path:'productConfig/edit',//产品配置
          name:'productConfigEdit',
          component:productConfigEdit
        },
        {
          path:'withhold/edit',//代扣配置
          name:'withholdEdit',
          component:withholdEdit
        },
        {
          path:'messageSend/edit',//短信提醒配置
          name:'messageSendEdit',
          component:messageSendEdit
        },
        {
          path:'flowConfig/edit',//流程配置
          name:'flowConfigEdit',
          component:flowConfigEdit
        },
        //用户管理
        {
          path:'user/userList', //用户列表
          name:'userList',
          component:userList
        },
        {
          path:'user/userEdit',//用户详情
          name:'userEdit',
          component:userEdit,
        },
        {
          path:'user/vitality',//活跃度
          name:'vitality',
          component:vitality
        },
        {
          path:'user/feedback',//用户反馈
          name:'feedback',
          component:feedback
        },
        //运营管理
        {
          path:'operator/converRateList', //客户转化率
          name:'converRateList',
          component:converRateList
        },
        {
          path:'operator/passRateList',//新户、老户通过率
          name:'passRateList',
          component:passRateList,
        },
        {
          path:'operator/settleRateList',//结清率
          name:'settleRateList',
          component:settleRateList
        },
        {
          path:'channelRate/list',//渠道统计
          name:'channelRateList',
          component:channelRateList
        },
        //订单
        {
          path:'apply/list',//订单申请列表
          name:'applyList',
          component:applyList
        },
        {
          path:'audit/list',//待人工审核列表
          name:'auditList',
          component:auditList
        },
        {
          path:'auditSuccess/list',//审核成功列表
          name:'auditSuccessList',
          component:auditSuccessList
        },
        {
          path:'auditReject/list',//审核拒绝列表
          name:'auditRejectList',
          component:auditRejectList
        },
        {
          path:'latePayment/list',//逾期已还
          name:'latePaymentList',
          component:latePaymentList
        },
        {
          path:'lateNoPayment/list',//逾期未还
          name:'lateNoPaymentList',
          component:lateNoPaymentList
        },
        {
          path:'late/list',//逾期未还
          name:'late',
          component:lateList
        },
        {
          path:'nowExpire/list',//当天到期
          name:'nowExpireList',
          component:nowExpireList
        },
        {
          path:'settle/list',//已结清
          name:'settleList',
          component:settleList
        },
        //财务管理
        {
          path:'callReview/list',//财务电核
          name:'callReviewList',
          component:callReviewList
        },
        {
          path:'payFinish/list',//已放款
          name:'payFinishList',
          component:payFinishList
        },
        {
          path:'waitPay/list',//待放款
          name:'waitPayList',
          component:waitPayList
        },
        {
          path:'paying/list',//放款中
          name:'payingList',
          component:payingList
        },
        {
          path:'payFail/list',//放款失败
          name:'payFailList',
          component:payFailList
        },
        {
          path:'receipt/list',//收款流水
          name:'receiptList',
          component:receiptList
        },
        {
          path:'waitReceipt/list',//待收款统计
          name:'waitReceiptList',
          component:waitReceiptList
        },
        {
          path:'repay/list',//待收款统计
          name:'repayList',
          component:repayList
        },

        //运营管理
        {
          path:'banner/list',//banner
          name:'bannerList',
          component:bannerList
        },
        {
          path:'channel/list',//渠道管理
          name:'channelList',
          component:channelList
        },
        {
          path:'notice/list',//公告管理
          name:'noticeList',
          component:noticeList
        },
        {
          path:'credit/list',//产品管理
          name:'creditList',
          component:creditList
        },
        {
          path:'credit/edit',//产品管理
          name:'creditEdit',
          component:creditEdit
        },

        //数据管理
        {
          path:'passRate/list',//客户通过率
          name:'passRateList',
          component:passRateList
        },
        {
          path:'converRate/list',//客户转化率
          name:'converRateList',
          component:converRateList
        },
        {
          path:'settleRate/list',//客户结清率
          name:'settleRateList',
          component:settleRateList
        },


        //催收
        {
          path:'urge/list',//催收列表
          name:'urgeList',
          component:urgeList
        },
        {
          path:'urgeTZone/list',//T0催收列表
          name:'urgeTZoneList',
          component:urgeTZoneList
        },
        {
          path:'urgeTOne/list',//T1催收列表
          name:'urgeTOneList',
          component:urgeTOneList
        },
        {
          path:'manyDays/list',//M1催收列表
          name:'manyDaysList',
          component:manyDaysList
        },
        {
          path:'urgeMine/list',//我的催收列表
          name:'urgeMineList',
          component:urgeMineList
        },
        {
          path:'statistical/list',//催收统计
          name:'statisticalList',
          component:statisticalList
        },

        //风控管理
        {
          path:'expire/list',//订单到期统计
          name:'expireList',
          component:expireList
        },
        {
          path:'orderAudit/list',//订单管理统计
          name:'orderAuditList',
          component:orderAuditList
        },

      ]
    }
  ]
})
